<cfif not structKeyExists(config,'query') and structKeyExists(config,'sql')>
	<cfif not structKeyExists(config,'dsn')>
		<cfset parent.showException(tag,'DSN attribute must be specified to use with SQL attribute or CF_SQL tag.', 3, attributeCombination)/>
	<cfelseif not structKeyExists(config,'value') and not structKeyExists(config,'option')>
		<cfset parent.showException(tag,'Either VALUE or OPTION attribute must be specified to use with SQL attribute or CF_SQL tag.',3,attributeCombination)/>
	</cfif>
	<cftry>
		<cfquery datasource="#config.dsn#" name="config.query">
			#CONFIG.SQL#
		</cfquery>
		<cfcatch type="any">
			<cfset parent.showException(tag,'Having difficulties executing your SQL statement. Please make sure it syntactically correct.',3,attributeCombination)/>
		</cfcatch>
	</cftry>
</cfif>

<cfif structKeyExists(config,'result') and structKeyExists(config,'query')>
	<cfif listFindNoCase('request,session,application',listfirst(config.result,'.'),'.')>
		<cfset "#config.result#" = config.query/>
	<cfelse>
		<cfset caller[config.result] = config.query/>
	</cfif> 
</cfif>